﻿@model PagedAlertModel
@{
    var grid = new WebGrid(null, rowsPerPage: Model.PageSize,
         ajaxUpdateContainerId: "gridAlertTable", canPage: true, canSort: true, ajaxUpdateCallback: "colorfulTheAlert");
    grid.Bind(Model.Alerts, new[] { "Severity", "Msg", "Timestamp", "Host" }, autoSortAndPage: false, rowCount: int.Parse(Model.TotalRows + ""));
}
<div id="gridAlertTable">
@grid.GetHtml(tableStyle: "ContactTB talbe_gray", headerStyle: "ContactTH",htmlAttributes:new {width="100%",border=0,cellpadding=0,cellspacing=0},
    columns: grid.Columns(grid.Column("Severity", "Severity", style: "Hiden"), 
    grid.Column("Msg", "告警信息"),
    grid.Column("Timestamp", "产生时间"),
    grid.Column("Host", "主机地址")))
<input type="button" onclick="loadAlertTable()" value="全部告警刷新" />
</div>